<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>箭头函数对象</title>
	</head>
	<body>
		<script type="text/javascript">
			//箭头函数实现
			let obj = {
			person:[3200,6000,10000,15000,20000],
			num:2000,
			//添加一个涨薪的方法，调用这个方法就可以返回涨薪后的工资
			add_salary()
			{
				let arr = this.person.map((value)=>{
					return value + this.num;
				 }) 
				 return arr
			  }
			}
			console.log(obj.add_salary());
			//普通函数实现
			let obj2 = 
			{
				person:[3200,6000,10000,15000,20000],
				num:2000,
				add_salary(){
					let that = this;
					let arr = this.person.map(function(value){
						return value + that.num;
					})
					return arr;
				}
			}
			console.log(obj2.add_salary());
		</script>
	</body>
</html>
